package com.yanqu.road.server.cmd.peakstronghold;

import com.yanqu.road.logic.pb.CrossRankPb;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.PeakStrongholdWarProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.peakstronghold.CrossPeakStrongholdMgr;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_PEAK_STRONGHOLD_UPDATE_UNION_BASE, desc = "更新联盟据点信息，有改变就上传")
public class CrossPeakStrongholdUpdateUnionBaseCmd extends CrossUnionCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        PeakStrongholdWarProto.CrossUpdateUnionBaseMsgReq req = PeakStrongholdWarProto.CrossUpdateUnionBaseMsgReq.parseFrom(packet.getBytes());
        CrossPeakStrongholdMgr.updateUnionBase(req.getActivityId(), req.getUnionUid(), req.getUpdateTime(), CrossRankPb.parseUnionBaseInfo(req.getUnionInfo()));
    }

    @Override
    public void sendData() {

    }
}
